<template>
  <div>
    <v-card class="parameters-page-card">
      <UiFormEdition
        :model="AttendanceBookingReason"
        go-back-route="/parameters/attendances"
      >
        <template #default="{ entity }">
          <UiInputText
            v-model="entity.reason"
            field="reason"
            :rules="rules()"
          />
        </template>
      </UiFormEdition>
    </v-card>
  </div>
</template>
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
import AttendanceBookingReason from '~/models/Booking/AttendanceBookingReason'

definePageMeta({
  name: 'attendanceBookingReason',
})

const i18n = useI18n()

const rules = () => [
  (reason: string | null) =>
    (reason !== null && reason.length > 0) || i18n.t('please_enter_a_value'),
]
</script>
